This application relates to computer-aided-design systems, and in particular, to methods and systems for providing dynamic links between a geometric model and the constituents of that geometric model.
A computer-aided design (CAD) system is a tool for creating geometric models on a computer system. These geometric models, which are typically representative of physical objects, are built by a designer using a series of commands that instruct the system to create geometric primitives, such as edges and vertices, and to operate on these geometric primitives using various procedures supplied with the CAD system. These operations result in the creation of geometric elements which can then be assembled, using additional procedures, into a geometric model.
A typical procedure supplied with a CAD system generates an output representative of a geometric structure on the basis of one or more input parameters in an input parameter list. For example, a procedure might accept a circle, an axis, and an angle as input parameters and create a solid by rotating the circle about the axis by the angle. Another procedure might accept a polygon and a length as input parameters and extrude that polygon to the extent specified by the length, thereby generating a prism having the polygon as its cross-section. Yet another procedure might accept, as input parameters, two intersecting faces and return a structure in which the intersection of the input faces is smoothed out into a curve. One or more of the input parameters passed to a procedure can itself be the output of another procedure. This ability to evaluate compositions of procedures enables the designer to build geometric models of complex physical objects by performing a sequence of operations on relatively simple constituent components.
To create a geometric model, a designer typically performs successive transformations on geometric primitives. For example, to generate the relatively simple prism shown in FIG. 1, a designer might define six edges 12a-f. The effect of this definition persists in time, thereby allowing the edges to be used as input parameters for subsequently called procedures. The designer would then apply an extrusion procedure to generate a prism 16 by extending the hexagon 12 formed by these six edges 12a-f along a principal axis 18. For more complex geometric models, a lengthy chain of procedures is often required, with the output of one procedure serving as an input to the next procedure in the chain. An example of pseudo-code one might use to describe the construction of the geometric model in FIG. 1 is shown in FIG. 5.
FIG. 2 illustrates a prior art data structure 20 representative of a geometric model designated by a pointer to the output of a third procedure 22. This third procedure 22 has a pointer to both a first geometric primitive 23 and the output of a second procedure 24. As a result, the first geometric primitive 23 and the output of the second procedure 24 are input parameters in the input parameter list of the third procedure 22. The second procedure 24 has a first pointer to the output of a first procedure 25 and a second pointer to a second geometric primitive 26. As a result, the second geometric primitive 26 and the output of the first procedure 25 are input parameters in the input parameter list of the second procedure 24. The first procedure 25 has three pointers: a first pointer directed to a third geometric primitive 27, a second pointer directed to a fourth geometric primitive 28, and a third pointer directed to a fifth geometric primitive 29. Consequently, the input parameter list of the first procedure includes, as input parameters, the third, fourth, and fifth geometric primitives. Consequently, the input parameter list of the first procedure includes as input parameters, the third, fourth, and fifth geometric primitives.
In most cases, a design undergoes several iterations before completion. Each iteration can require revisions having ramifications that propagate throughout the geometric model. For example, with reference to FIG. 1, if the designer were to lengthen two edges 12b, 12e, the appearance of the entire prism 16 would have to be altered, as shown in FIG. 3. Were this prism 16 to be an input parameter to a second procedure, the output of that second procedure would most likely have to be altered.
Examination of FIG. 2 suggests that a change in, for example, the second geometric primitive 26 will be manifested in a change in the output of the second procedure 24 because the second procedure 24 has a pointer directed at the second geometric primitive 26. The result of changing the second geometric primitive 26 will be manifested in a change in the output of the third procedure 27 because that procedure includes a pointer to the output of the second procedure 26. As a result, the change in the second geometric primitive 26 is manifested in a change in the geometric model, which has a pointer directed to the output of the third procedure 27.
It is thus known in the art to dynamically link the output of one procedure to the input of another procedure in such a way that the ramifications of a change in the dimensions of a geometric primitive propagate throughout the geometric model. This ability to dynamically update the geometric model is made possible by the fact that the constituent geometric primitives of a geometric model have unique tags, or identifiers, that are available to each procedure. Consequently, a procedure can accommodate changes in an input parameter by looking up the tag associated with that input parameter and obtaining the properties associated with the constituent element identified by that tag.
A more fundamental change to the geometric model poses significant problems in dynamically updating that model. For example, it is not possible to transform the prism in FIG. 1 into the prism shown in FIG. 4 by merely changing the dimensions or the orientation of existing edges. Instead, it is necessary to actually delete two edges 12e, 12f. Examination of the pseudo-code shown in FIG. 5 suggests a lurking difficulty in deleting an edge. Since two of the edges 12e, 12f in the input parameter list of the extrude function will no longer exist, the extrude function will encounter an error. This disadvantage arises from the fact that in conventional methods of geometric modeling, even if the values of the parameters in the input parameter list are dynamically bound to the procedure, the input parameter list itself is statically bound to that procedure. Hence, although a procedure can be responsive to a change in the value of one of the input parameters in its input parameter list, it cannot readily respond to a change in the input parameter list itself.
In the context of the foregoing example, a change in the length of the edge 12e, as shown in FIG. 3, is merely a change in the value of an input parameter in an input parameter list. Such a change can readily be accommodated by known geometric modeling systems in which parameter values are dynamically bound to the procedure. However, the actual deletion of the edge 12e, as shown in FIG. 4, is a change in the input parameter list itself. Such a fundamental change cannot readily be accommodated by existing geometric modeling systems.
The difficulty associated with such a fundamental change in the geometric model is also apparent from FIG. 2. For example, the outright deletion of the second geometric primitive 26 results in the second procedure 24 having a stray pointer with nothing to point to. Consequently, in order to avoid an error in the second procedure 24, this stray pointer must also be deleted. Although this appears to be a relatively simple task in the simple example of FIG. 2, for a geometric model of even moderate complexity, there may be a large number of stray pointers, in which case the process of deleting stray pointers is a laborious one.
Conversely, if an additional geometric primitive is to be added to the geometric model, or if an additional procedure is to be used in constructing the model, additional pointers may have to be created and existing pointers may have to be moved. This task can become even more laborious than the task of deleting stray pointers.
A change of this fundamental nature requires the designer to manually redesignate the constituent elements that are to form the input parameters for the various procedures used to generate the geometric model. In effect, the designer must alter the pseudo-code shown in FIG. 5 (generally by pointing and clicking on a visual rendition of the geometric model rather than by actually writing code) to change the input parameter list associated with the individual procedures. This would result in pseudo-code instructions equivalent to those shown in FIG. 6.
It is apparent from the foregoing that in the case of complex designs built by dozens of procedures, fundamental changes involving insertion and deletion of constituent geometric primitives can be laborious tasks. Hence, what is desireable in the art is a method and system for dynamically updating geometric models even when fundamental changes are made to the underlying constituents of that model.
The shortcomings of the prior art are addressed by associating selected constituent elements of the geometric model and providing pointers to each of these selected constituent elements. These pointers form the basis for defining a logical element that is dynamically linked to the selected constituent elements and that can be referenced in an input parameter list of a procedure.
The method of the invention thus includes the steps of associating a plurality of selected constituent elements and a corresponding plurality of pointers to each of the selected constituent elements. The constituent elements and the pointers define a logical element. The method further includes the step of establishing a dynamic link between the logical element and the constituent elements through the pointers corresponding to those constituent elements. The logical element is then passed as an input parameter to a procedure having as its output a geometric model representative of a physical object.
A result of carrying out the method of the invention is that the resulting geometric model is automatically responsive to changes in the constituent elements. This desirable result is achieved because it is the logical element which is dynamically linked to the constituent elements, that is passed to the procedure and not the constituent elements themselves.
A data structure for practice of the invention includes a plurality of selected constituent elements selected from a plurality of constituent elements. These selected constituent elements are associated with a logical element by a corresponding plurality of pointers linking the selected constituent elements to the logical element. Each pointer includes a dynamic link such that a change in the selected constituent element is manifested in a change in a geometric model that includes the logical element.
By referencing a logical element instead of the selected constituent elements themselves, the procedure insulates itself from errors resulting from changes in those constituent elements. These changes can include not only changes in the values of the parameters associated with those constituent geometric elements but also changes in the number or type of those elements.
The selected constituent elements need not be selected from the set of geometric elements that make up the fundamental building blocks of the geometric model. These constituent elements can also include other logical elements or other data structures representative of geometric objects. Such data structures can be user-supplied data structures or outputs of other procedures.